SOUND EFFECTS
=============

Every sound in the game is a WAV file in this folder, loaded when the game
needs it. Replace a file to change a sound; add a file to add one. No
rebuild needed.

Sound ids
---------
A sound's id is its path here without ".wav", with forward slashes:
    battle/fire.wav    -> "battle/fire"
    ui/cursor.wav      -> "ui/cursor"
Files named <name>_2.wav, <name>_3.wav ... are variants of <name>, and each
play picks one at random (battle/hit.wav + battle/hit_2.wav).
Any WAV works: PCM 8/16/24/32-bit or 32-bit float, mono or stereo, any rate.

Menu sounds (ui/)
-----------------
cursor   the cursor moves to another option
confirm  an option is chosen
cancel   backing out of something
open     a menu opens
close    a menu closes
error    the choice isn't allowed (no MP, on cooldown...)

Battle sounds from Lua
----------------------
An action (Data/Actions/<Job>/<id>.lua) names its sounds in the table its
script returns:

    return {
        onExecute = onExecute,
        sounds = { cast = "battle/fireball", hit = "battle/fire_hit" },
    }

Phases: cast (the action starts), hit (each target damaged), crit (layered
over hit on a critical), heal (each target healed), miss (each dodge).
A value is a sound id, a list of ids to pick from at random, or false for
silence. Consumables (Data/Items/Consumables) do the same with M.sounds.

A single hit can override the hit sound in its flags:
    helper.hitAttempt(ctx, dmg, { type = "magic", sound = "battle/ice" }, caster, targets)

And any script can play a sound at an exact moment:
    Sound.play("battle/thunder")              -- id
    Sound.play("battle/hit", 0.5)             -- half volume
    Sound.play("battle/hit", 1, 0.8)          -- lower pitch
    Sound.play({ "battle/hit", "battle/punch" })  -- one of these
    if Sound.exists("custom/roar") then ... end

Anything an action doesn't name comes from Data/System/sound_defaults.lua
(defaults by action type, damage type, heals, misses, deaths, enemy charge-ups).

Custom sounds: put them anywhere in this folder, e.g. Sounds/custom/roar.wav,
and use "custom/roar".

Volume: the Sound and Menu Sounds bars on the field menu's Config screen
(saved in profile.json). soundVolume and menuSoundVolume in
Settings/gameplay_options.json are the defaults before a bar is moved.
